﻿package code.admin 
{
	import code.Core;
	import flash.display.Sprite;
	import code.interfaces.IAdmin;
	import code.events.GeminiEvent;

	public class AdminDispatcher extends Sprite implements IAdmin
	{
		protected  var _mainframe;
		protected var _modules:Array;
		
		
		public function Selected(e)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,this));
			
		}
		public function startAdmin(e)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,this));
			dispatchEvent(new AdminEvent(AdminEvent.ADMIN_START));
		}
		public function endAdmin(e)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,this));
			dispatchEvent(new AdminEvent(AdminEvent.ADMIN_END));
		}
		public function setBackground(lnk)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,this));
		}
		
		public function openAdminModule(mod)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,mod));
		}
		public function closeAdminModule(mod)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,mod));
		}
		public function moduleAdminItem(mod)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,mod));
		}
		public function getAdminModule(mod)
		{
			dispatchEvent(new GeminiEvent(GeminiEvent.GEMINI_UPDATE,mod));
		}
		public function set mainframe(mf:*)
		{
			_mainframe=mf;	
		}
		public function get mainframe():*
		{
			return _mainframe;
		}
	}
}